<?php
/**
 * Created by PhpStorm.
 * User: Yangxufeng
 * Date: 2018/8/28
 * Time: 17:14
 */

namespace app\index\controller;

use app\index\server\MessageServer;
use app\index\validate\GetListValidate;
use app\index\validate\IDMustBePostiveInt;
use think\Exception;

class Message extends Auth
{
    protected $server;

    public function __construct()
    {
        $this->server = new MessageServer();
    }

    public function getMessageList()
    {
        $params = ( new GetListValidate() )->goCheck();
        $result = $this->server->getList($params);
        return $result;
    }

    public function addOrUpdate()
    {

    }

    public function detail($id)
    {
        ( new IDMustBePostiveInt() )->goCheck();
        $result = $this->server->detail($id);
        return $result;
    }

    public function changeStatus($id)
    {
        ( new IDMustBePostiveInt() )->goCheck();
        $result = $this->server->changeStatus($id);
        return $result;
    }
}